#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace CustomImport {

	/// <summary>
	/// Summary for CustomImportForm
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class CustomImportForm : public System::Windows::Forms::Form
	{
	public:
		CustomImportForm(void)
		{
			InitializeComponent();
		}

		CustomImportForm(String^ strDatabaseConnectionString)
		{
			m_strDatabaseConnectionString = strDatabaseConnectionString;
			InitializeComponent();
		}
	private:
		literal String^ HeaderTableQuery = L"SELECT [SampleHeaderUID],[PlateBarCode],[PlateFileUploadedOn],[ProcessedBy],[ProcessedOn] FROM [dbo].[tblSampleHeader]";

		String^ m_strDatabaseConnectionString;

		void ReadDatabaseImports();

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~CustomImportForm()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::LinkLabel^  lnkRefresh;
	protected: 
	private: System::Windows::Forms::TabControl^  tabControl;
	private: System::Windows::Forms::TabPage^  tbpSamplesForImport;
	private: System::Windows::Forms::ListView^  listView1;
	private: System::Windows::Forms::ColumnHeader^  colPlateBarcode;
	private: System::Windows::Forms::ColumnHeader^  colUpdateDate;
	private: System::Windows::Forms::ColumnHeader^  colResults;
	private: System::Windows::Forms::TabPage^  tbpImported;

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->lnkRefresh = (gcnew System::Windows::Forms::LinkLabel());
			this->tabControl = (gcnew System::Windows::Forms::TabControl());
			this->tbpSamplesForImport = (gcnew System::Windows::Forms::TabPage());
			this->listView1 = (gcnew System::Windows::Forms::ListView());
			this->colPlateBarcode = (gcnew System::Windows::Forms::ColumnHeader());
			this->colUpdateDate = (gcnew System::Windows::Forms::ColumnHeader());
			this->colResults = (gcnew System::Windows::Forms::ColumnHeader());
			this->tbpImported = (gcnew System::Windows::Forms::TabPage());
			this->tabControl->SuspendLayout();
			this->tbpSamplesForImport->SuspendLayout();
			this->SuspendLayout();
			// 
			// lnkRefresh
			// 
			this->lnkRefresh->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
			this->lnkRefresh->AutoSize = true;
			this->lnkRefresh->Location = System::Drawing::Point(559, 2);
			this->lnkRefresh->Name = L"lnkRefresh";
			this->lnkRefresh->Size = System::Drawing::Size(70, 13);
			this->lnkRefresh->TabIndex = 3;
			this->lnkRefresh->TabStop = true;
			this->lnkRefresh->Text = L"Refresh Data";
			// 
			// tabControl
			// 
			this->tabControl->Controls->Add(this->tbpSamplesForImport);
			this->tabControl->Controls->Add(this->tbpImported);
			this->tabControl->Dock = System::Windows::Forms::DockStyle::Fill;
			this->tabControl->Location = System::Drawing::Point(0, 0);
			this->tabControl->Name = L"tabControl";
			this->tabControl->SelectedIndex = 0;
			this->tabControl->Size = System::Drawing::Size(632, 422);
			this->tabControl->TabIndex = 2;
			// 
			// tbpSamplesForImport
			// 
			this->tbpSamplesForImport->Controls->Add(this->listView1);
			this->tbpSamplesForImport->Location = System::Drawing::Point(4, 22);
			this->tbpSamplesForImport->Name = L"tbpSamplesForImport";
			this->tbpSamplesForImport->Padding = System::Windows::Forms::Padding(3);
			this->tbpSamplesForImport->Size = System::Drawing::Size(624, 396);
			this->tbpSamplesForImport->TabIndex = 0;
			this->tbpSamplesForImport->Text = L"Samples For Import";
			this->tbpSamplesForImport->UseVisualStyleBackColor = true;
			// 
			// listView1
			// 
			this->listView1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 
				| System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(3) {this->colPlateBarcode, 
				this->colUpdateDate, this->colResults});
			this->listView1->Location = System::Drawing::Point(6, 6);
			this->listView1->Name = L"listView1";
			this->listView1->Size = System::Drawing::Size(612, 384);
			this->listView1->TabIndex = 0;
			this->listView1->UseCompatibleStateImageBehavior = false;
			this->listView1->View = System::Windows::Forms::View::Details;
			// 
			// colPlateBarcode
			// 
			this->colPlateBarcode->Text = L"Plate Barcode";
			this->colPlateBarcode->Width = 172;
			// 
			// colUpdateDate
			// 
			this->colUpdateDate->Text = L"Upload Date";
			this->colUpdateDate->Width = 154;
			// 
			// colResults
			// 
			this->colResults->Text = L"LIS Data Results";
			this->colResults->Width = 256;
			// 
			// tbpImported
			// 
			this->tbpImported->Location = System::Drawing::Point(4, 22);
			this->tbpImported->Name = L"tbpImported";
			this->tbpImported->Padding = System::Windows::Forms::Padding(3);
			this->tbpImported->Size = System::Drawing::Size(599, 321);
			this->tbpImported->TabIndex = 1;
			this->tbpImported->Text = L"Imported Samples";
			this->tbpImported->UseVisualStyleBackColor = true;
			// 
			// CustomImportForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(632, 422);
			this->ControlBox = false;
			this->Controls->Add(this->lnkRefresh);
			this->Controls->Add(this->tabControl);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = L"CustomImportForm";
			this->Text = L"Custom Import";
			this->tabControl->ResumeLayout(false);
			this->tbpSamplesForImport->ResumeLayout(false);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	};
}
